package com.yeyks.commonReference.service.consumer.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.yeyks.common.constants.ConfigKey;
import com.yeyks.common.constants.consumer.UserInviteRelationTypeConstant;
import com.yeyks.common.em.CashOutOrderStatus;
import com.yeyks.common.em.UserBillType;
import com.yeyks.common.exception.ServiceException;
import com.yeyks.common.utils.RedisUtil;
import com.yeyks.commonReference.service.config.ConfigService;
import com.yeyks.commonReference.service.consumer.CashOutOrderService;
import com.yeyks.consumer.dal.dao.UserAccountOverviewMapper;
import com.yeyks.consumer.dal.domain.*;
import com.yeyks.consumer.param.UserAccountOverview.*;
import com.yeyks.consumer.service.*;
import com.yeyks.consumer.vo.UserAccountOverviewInfoVo;
import com.yeyks.consumer.vo.UserAccountOverviewInviteDetailVo;
import com.yeyks.consumer.vo.UserAccountOverviewInvitedUserListVo;
import com.yeyks.consumer.vo.UserAccountOverviewWithdrawalInquiryVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;


/**
 * <p>
 * 用户账户总览表 服务实现类
 * </p>
 *
 * @author yun
 * @since 2019-06-25
 */
@Slf4j
@Service
public class UserAccountOverviewServiceImpl extends ServiceImpl<UserAccountOverviewMapper, UserAccountOverview> implements UserAccountOverviewService {

    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    UserBillService userBillService;
    @Autowired
    RechargeRecordService recordService;
    @Autowired
    private ConfigService configService;
    @Autowired
    private UserInviteRelationService userInviteRelationService;
    @Autowired
    private UserInfoService userInfoService;
    @Autowired
    private CashOutOrderService cashOutOrderService;
    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    private UserMakerService userMakerService;

    private static final String key = "redisLock:UserAccountOverviewServiceImpl:addAmount";

    /**
     * 通过用户的id查询用户账户信息(没有则创建)
     *
     * @param userId
     * @param type   佣金类型
     * @return
     */
    @Override
    public UserAccountOverview getUserAccountNoCreate(Integer userId, Integer type) {
        UserAccountOverview account = baseMapper.selectOne(
                new QueryWrapper<UserAccountOverview>()
                        .eq(UserAccountOverview.USER_ID, userId)
                        .eq(UserAccountOverview.TYPE, type)
                        .last("limit 1")
        );
        if (account == null) {
            account = getUserAccount(userId, type);
            int res = baseMapper.insert(account);
            if (res != 1) {
                throw new ServiceException("用户账户信息异常");
            }
        }
        return account;
    }

    /**
     * 增加账户金额
     *
     * @param amount     操作金额数
     * @param userId     用户id
     * @param billType   账单类型：1 充值 2 佣金 3、提现 4、消费, 5 0元推广分红
     * @param remark     备注
     * @param amountType 佣金类型
     * @return
     */
    @Override
    @Transactional
    public Boolean addAmount(Integer amount, Integer userId, Integer billType, String remark, Integer amountType) {
        if (amount == null) {
            amount = 0;
        }
        UserAccountOverview account = getUserAccountNoCreate(userId, amountType);
        if (account == null) {
            return false;
        }
        Integer finalAmount = amount;
        return redisUtil.runWithLock(key, () -> {
            try {
                account.setTotalInAmount(account.getTotalInAmount() == null ? 0 : account.getTotalInAmount() + finalAmount);
                int outAmount = account.getOutAmount() == null ? 0 : account.getOutAmount();
                account.setRemainAmount(account.getTotalInAmount() - outAmount < 0 ? 0 : account.getTotalInAmount() - outAmount);
                account.setUpdateTime(new Date());
                baseMapper.updateById(account);
                UserBill userBill = getUserBill(account, finalAmount, remark, billType);
                return userBillService.save(userBill);
            } catch (Exception e) {
                log.error("增加账户金额异常{}", e.getLocalizedMessage());
                return false;
            }
        });
    }

    private UserAccountOverview getUserAccount(Integer userId, Integer type) {
        UserAccountOverview overview = new UserAccountOverview();
        overview.setTotalInAmount(0);
        overview.setUserId(Long.valueOf(userId));
        overview.setType(type);
        overview.setRemainAmount(0);
        overview.setOutAmount(0);
        Date date = new Date();
        overview.setCreateTime(date);
        overview.setUpdateTime(date);
        return overview;
    }


    /**
     * 减少账户金额
     *
     * @param amount     操作金额数
     * @param userId     用户id
     * @param remark     备注
     * @param billType   账单类型：1 充值 2 佣金 3、提现 4、消费
     * @param amountType 提现佣金类型,1,0元,2创客
     * @return
     */
    @Override
    @Transactional
    public Boolean descAmount(Integer amount, Integer userId, Integer billType, String remark, Integer amountType) {
        try {
            if (amount == null) {
                amount = 0;
            }
            UserAccountOverview userAccountOverview = getUserAccountNoCreate(userId, amountType);
            if (userAccountOverview == null) {
                log.info("账户信息为空{}", userId);
                throw new ServiceException("账户信息为空");
            }
            if (UserBillType.WITHDRAW.desc().equals(remark)) {
                Integer overAmount = getOverAmount(amountType);
                if (userAccountOverview.getRemainAmount() < overAmount) {
                    log.info("提现金额不满{}", overAmount);
                    throw new ServiceException("不满足提现条件");
                }
            }
            if (amount > userAccountOverview.getRemainAmount()) {
                log.info("减少账户余额失败,消费金额{}，账户余额{}", amount, userAccountOverview.getTotalInAmount());
                throw new ServiceException("账户余额不足");
            }
            userAccountOverview.setOutAmount(userAccountOverview.getOutAmount() == null ? 0 : userAccountOverview.getOutAmount() + amount);
            userAccountOverview.setRemainAmount(userAccountOverview.getTotalInAmount() - userAccountOverview.getOutAmount());
            userAccountOverview.setUpdateTime(new Date());
            if (!updateById(userAccountOverview)) {
                throw new ServiceException("余额修改失败");
            }
            UserBill userBill = getUserBill(userAccountOverview, amount, remark, billType);
            if (!userBillService.save(userBill)) {
                throw new ServiceException("余额记录创建失败");
            }
            return true;
        } catch (Exception e) {
            log.error("减少账户金额异常{}", e.getLocalizedMessage());
            throw e;
        }
    }

    private Integer getOverAmount(Integer amountType) {
        try {
            Integer overAmount = 5000;
            switch (amountType) {
                case UserInviteRelationTypeConstant.INVITE_ZERO:
                    overAmount = Convert.toInt(configService.getValue(ConfigKey.EXTRACT_OVER_AMOUNT_ZERO), 100);
                    break;
                case UserInviteRelationTypeConstant.INVITE_PAY:
                    overAmount = Convert.toInt(configService.getValue(ConfigKey.EXTRACT_OVER_AMOUNT), 5000);
                    break;
                default:
                    overAmount = Convert.toInt(configService.getValue(ConfigKey.EXTRACT_OVER_AMOUNT_DOUBLEDAN), 30);
                    break;
            }
            return overAmount;
        } catch (Exception e) {
            log.error("获取用户提现满减金额异常", e.getLocalizedMessage());
            e.printStackTrace();
        }
        return 5000;
    }

    //用户推广信息
    @Override
    public UserAccountOverviewInfoVo info(UserAccountOverviewInfoParam param) {
        UserAccountOverviewInfoVo vo = new UserAccountOverviewInfoVo();
        vo.setInvitedT0Count(getInvitedCount(param.getUserId(), UserInviteRelationTypeConstant.INVITE_ZERO));
        vo.setInvitedT1Count(getInvitedCount(param.getUserId(), UserInviteRelationTypeConstant.INVITE_PAY));
        return vo;
    }

    //用户佣金信息
    @Override
    public UserAccountOverviewWithdrawalInquiryVo invitedAmount(UserAccountOverviewinvitedAmountParam param) {

        UserAccountOverviewWithdrawalInquiryVo userAccountOverviewWithdrawalInquiryVo = new UserAccountOverviewWithdrawalInquiryVo();

        //数据
        UserAccountOverview userAccountOverview = getUserAccountNoCreate(param.getUserId(), param.getType());
        BeanUtil.copyProperties(userAccountOverview, userAccountOverviewWithdrawalInquiryVo);

        //附加信息
        //提现最低满足金额
        Integer overAmount = getOverAmount(param.getType());
        userAccountOverviewWithdrawalInquiryVo.setOverAmount(overAmount);
        //订单状态
        CashOutOrder cashOutOrder = cashOutOrderService.getOne(
                new QueryWrapper<CashOutOrder>()
                        .eq(CashOutOrder.USER_ID, param.getUserId())
                        .eq(CashOutOrder.AMOUNT_TYPE, param.getType())
                        .orderByDesc(CashOutOrder.GMT_CREATE)
                        .last("limit 1")
        );
        userAccountOverviewWithdrawalInquiryVo.setStatus(
                (Objects.nonNull(cashOutOrder) && Objects.equals(CashOutOrderStatus.pre_check.value(), cashOutOrder.getStatus()))
                        ? cashOutOrder.getStatus()
                        : null
        );
        //提现间隔,一天
        userAccountOverviewWithdrawalInquiryVo.setFlag(!(Objects.nonNull(cashOutOrder) && cashOutOrder.getGmtCreate().after(DateUtil.offsetDay(new Date(), -1))));

        return userAccountOverviewWithdrawalInquiryVo;
    }

    /**
     * 按类型获取推广的人数
     *
     * @see UserInviteRelationTypeConstant
     */
    private int getInvitedCount(Integer userId, Integer type) {
        return userInviteRelationService.count(
                new QueryWrapper<UserInviteRelation>()
                        .eq(UserInviteRelation.PARENT_ID, userId)
                        .eq(UserInviteRelation.TYPE, type)
        );
    }


    //推荐用户信息列表
    @Override
    public List<UserAccountOverviewInvitedUserListVo> invitedUserList(UserAccountOverviewInvitedUserListParam param) {
        PageHelper.startPage(param.getPageNum(), param.getPageSize());
        List<UserAccountOverviewInvitedUserListVo> voList = baseMapper.invitedUserList(param);
        for (UserAccountOverviewInvitedUserListVo listVo : voList) {
            listVo.setPhone(StrUtil.replace(listVo.getPhone(), 3, 7, '*'));
        }
        return voList;
    }

    //按类型获取推广信息
    @Override
    public UserAccountOverviewInviteDetailVo invitedDetail(UserAccountOverviewInviteDetailParam param) {
        UserInfo userInfo = userInfoService.getById(param.getUserId());
        if (Objects.isNull(userInfo)) {
            throw new ServiceException("用户不存在");
        }
        UserAccountOverviewInviteDetailVo vo = new UserAccountOverviewInviteDetailVo();
        switch (param.getInviteType()) {
            case 1:
                vo.setPrice(userBillService.sumBillByUserIdAndType(param.getUserId(), 5));
                break;
            case 2:
                vo.setPrice(userBillService.sumBillByUserIdAndType(param.getUserId(), 2));
                String value = configService.getValue(ConfigKey.ACTIVITY_PAY_URL);
                JSONObject jsonObject = JSONObject.parseObject(value);
                vo.setUrl((String) jsonObject.get("url"));
                vo.setGiftUrl((String) jsonObject.get("giftUrl"));
                vo.setPurchaseVipCard(jsonObject.getString("purchaseVipCard"));
                vo.setInviteCode(userInfo.getInviteCode());
                UserMaker userMaker = userMakerService.getOne(
                        new QueryWrapper<UserMaker>()
                                .eq(UserMaker.USER_ID, param.getUserId())
                );
                vo.setMakerLevel(
                        Objects.nonNull(userMaker) ? userMaker.getMakerLevel() : 1
                );
                break;
            default:
                throw new ServiceException("类型错误");
        }
        vo.setCount(getInvitedCount(param.getUserId(), param.getInviteType()));
        return vo;
    }

    /**
     * 获取用户账户等相关信息
     *
     * @param userInfo
     * @return
     */
//    @Override
//    public UserAccountOverviewDTO info(UserInfo userInfo) {
//        UserAccountOverviewDTO userAccountOverviewDTO = null;
//        try {
//            UserAccountOverview account = getUserAccountNoCreate(userInfo.getId());
//            userAccountOverviewDTO = ObjectConvertUtil.convertObject(account, UserAccountOverviewDTO.class);
//            userAccountOverviewDTO.setInviteId(userInfo.getInviteCode());
//            //获取推广人数
////            Integer count = recordService.selectCountByInviteId(userInfo.getInviteCode());
//            int count = userInviteRelationService.count(
//                    new QueryWrapper<UserInviteRelation>()
//                            .eq(UserInviteRelation.PARENT_ID, userInfo.getId())
//                            .eq(UserInviteRelation.TYPE, UserInviteRelationTypeEnum.MAKER.getValue())
//            );
//            userAccountOverviewDTO.setPeopleSize(count);
//            setUrl(userAccountOverviewDTO);
//        } catch (Exception e) {
//            log.error("获取用户账户等相关信息异常{}", e.getLocalizedMessage());
//            e.printStackTrace();
//        }
//        return userAccountOverviewDTO;
//    }

//    private void setUrl(UserAccountOverviewDTO userAccountOverviewDTO) {
//        try {
//            String value = configService.getValue(ConfigKey.ACTIVITY_PAY_URL);
//            JSONObject jsonObject = JSONObject.parseObject(value);
//            userAccountOverviewDTO.setUrl((String) jsonObject.get("url"));
//            userAccountOverviewDTO.setGiftUrl((String) jsonObject.get("giftUrl"));
//        } catch (Exception e) {
//            log.error("获取活动充值链接异常{}", e.getLocalizedMessage());
//        }
//    }
    private UserBill getUserBill(UserAccountOverview account, Integer amount, String remark, Integer type) {
        UserBill userBill = new UserBill();
        userBill.setAvaliableAmount(Long.valueOf(account.getRemainAmount()));
        userBill.setOperatorAmount(Long.valueOf(amount));
        userBill.setRemark(remark);
        userBill.setType(type);
        userBill.setUserId(account.getUserId());
        userBill.setCreateTime(new Date());
        return userBill;
    }

    //推手排行
    @Override
    public UserAccountOverviewMakerLeaderboardListVo makerLeaderboardList(String monthStr) {
        RowMapper<UserAccountOverviewMakerLeaderboardListInnerVo> rowMapper = new RowMapper<UserAccountOverviewMakerLeaderboardListInnerVo>() {
            @Override
            public UserAccountOverviewMakerLeaderboardListInnerVo mapRow(ResultSet rs, int rowNum) throws SQLException {
                UserAccountOverviewMakerLeaderboardListInnerVo userAccountOverviewMakerLeaderboardListInnerVo = new UserAccountOverviewMakerLeaderboardListInnerVo();
                userAccountOverviewMakerLeaderboardListInnerVo.setUserId(rs.getInt("userId"));
                userAccountOverviewMakerLeaderboardListInnerVo.setMakerInviteLevel(rs.getInt("makerInviteLevel"));
                userAccountOverviewMakerLeaderboardListInnerVo.setPhone(rs.getString("phone"));
                userAccountOverviewMakerLeaderboardListInnerVo.setAmount(rs.getString("amount"));
                return userAccountOverviewMakerLeaderboardListInnerVo;
            }
        };
        StringJoiner sj = new StringJoiner(",");

        UserAccountOverviewMakerLeaderboardListVo userAccountOverviewMakerLeaderboardListVo = new UserAccountOverviewMakerLeaderboardListVo();
        //1
        List<UserAccountOverviewMakerLeaderboardListInnerVo> userAccountOverviewMakerLeaderboardListInnerVos1 = jdbcTemplate.query("SELECT*FROM (SELECT ui.id userId,ui.phone phone,3 makerInviteLevel,uml.makerInviteLevelStr makerInviteLevelStr,sum(ub.operator_amount) amount FROM user_info ui JOIN user_bill ub ON ui.id=ub.user_id JOIN (SELECT uir.parent_id,GROUP_CONCAT(DISTINCT (um.maker_level)) makerInviteLevelStr FROM user_invite_relation uir JOIN user_maker um ON uir.user_id=um.user_id WHERE DATE_FORMAT(um.create_time,'%Y%m')='" + monthStr + "' GROUP BY uir.parent_id) uml ON ui.id=uml.parent_id WHERE ub.type=2" + (StrUtil.isNotBlank(sj.toString()) ? " and ui.id not in (" + sj.toString() + ")" : "") + " AND DATE_FORMAT(ub.create_time,'%Y%m')='" + monthStr + "' GROUP BY ui.id) a WHERE LOCATE('3',makerInviteLevelStr) ORDER BY amount DESC LIMIT 1", rowMapper);
        if (CollectionUtil.isNotEmpty(userAccountOverviewMakerLeaderboardListInnerVos1)) {
            userAccountOverviewMakerLeaderboardListVo.setOne(userAccountOverviewMakerLeaderboardListInnerVos1.get(0));
        }
        if (Objects.nonNull(userAccountOverviewMakerLeaderboardListVo.getOne())) {
            sj.add(String.valueOf(userAccountOverviewMakerLeaderboardListVo.getOne().getUserId()));
        }

        //2
        List<UserAccountOverviewMakerLeaderboardListInnerVo> userAccountOverviewMakerLeaderboardListInnerVos2 = jdbcTemplate.query("SELECT*FROM (SELECT ui.id userId,ui.phone phone,2 makerInviteLevel,uml.makerInviteLevelStr makerInviteLevelStr,sum(ub.operator_amount) amount FROM user_info ui JOIN user_bill ub ON ui.id=ub.user_id JOIN (SELECT uir.parent_id,GROUP_CONCAT(DISTINCT (um.maker_level)) makerInviteLevelStr FROM user_invite_relation uir JOIN user_maker um ON uir.user_id=um.user_id WHERE DATE_FORMAT(um.create_time,'%Y%m')='" + monthStr + "' GROUP BY uir.parent_id) uml ON ui.id=uml.parent_id WHERE ub.type=2" + (StrUtil.isNotBlank(sj.toString()) ? " and ui.id not in (" + sj.toString() + ")" : "") + " AND DATE_FORMAT(ub.create_time,'%Y%m')='" + monthStr + "' GROUP BY ui.id) a WHERE LOCATE('2',makerInviteLevelStr) ORDER BY amount DESC LIMIT 1", rowMapper);
        if (CollectionUtil.isNotEmpty(userAccountOverviewMakerLeaderboardListInnerVos2)) {
            userAccountOverviewMakerLeaderboardListVo.setTwo(userAccountOverviewMakerLeaderboardListInnerVos2.get(0));
        }
        if (Objects.nonNull(userAccountOverviewMakerLeaderboardListVo.getTwo())) {
            sj.add(String.valueOf(userAccountOverviewMakerLeaderboardListVo.getTwo().getUserId()));
        }

        //3
        List<UserAccountOverviewMakerLeaderboardListInnerVo> userAccountOverviewMakerLeaderboardListInnerVos3 = jdbcTemplate.query("SELECT*FROM (SELECT ui.id userId,ui.phone phone,1 makerInviteLevel,uml.makerInviteLevelStr makerInviteLevelStr,sum(ub.operator_amount) amount FROM user_info ui JOIN user_bill ub ON ui.id=ub.user_id JOIN (SELECT uir.parent_id,GROUP_CONCAT(DISTINCT (um.maker_level)) makerInviteLevelStr FROM user_invite_relation uir JOIN user_maker um ON uir.user_id=um.user_id WHERE DATE_FORMAT(um.create_time,'%Y%m')='" + monthStr + "' GROUP BY uir.parent_id) uml ON ui.id=uml.parent_id WHERE ub.type=2" + (StrUtil.isNotBlank(sj.toString()) ? " and ui.id not in (" + sj.toString() + ")" : "") + " AND DATE_FORMAT(ub.create_time,'%Y%m')='" + monthStr + "' GROUP BY ui.id) a WHERE LOCATE('1',makerInviteLevelStr) ORDER BY amount DESC LIMIT 1", rowMapper);
        if (CollectionUtil.isNotEmpty(userAccountOverviewMakerLeaderboardListInnerVos3)) {
            userAccountOverviewMakerLeaderboardListVo.setThree(userAccountOverviewMakerLeaderboardListInnerVos3.get(0));
        }
        if (Objects.nonNull(userAccountOverviewMakerLeaderboardListVo.getThree())) {
            sj.add(String.valueOf(userAccountOverviewMakerLeaderboardListVo.getThree().getUserId()));
        }

        String inStr = sj.toString();
        if (StrUtil.isNotBlank(inStr)) {
            inStr = " and ui.id not in (" + inStr + ")";
        }
        //剩下的
        userAccountOverviewMakerLeaderboardListVo.setList(
                jdbcTemplate.query("SELECT ui.id userId,ui.phone phone,uml.makerInviteLevel,sum(ub.operator_amount) amount FROM user_info ui JOIN user_bill ub ON ui.id=ub.user_id JOIN (SELECT uir.parent_id,max(um.maker_level) makerInviteLevel FROM user_invite_relation uir JOIN user_maker um ON uir.user_id=um.user_id WHERE DATE_FORMAT(um.create_time,'%Y%m')='" + monthStr + "' GROUP BY uir.parent_id) uml ON ui.id=uml.parent_id WHERE ub.type=2" + (StrUtil.isNotBlank(sj.toString()) ? " and ui.id not in (" + sj.toString() + ")" : "") + " AND DATE_FORMAT(ub.create_time,'%Y%m')='" + monthStr + "' GROUP BY ui.id ORDER BY amount DESC LIMIT 17", rowMapper)
        );
        return userAccountOverviewMakerLeaderboardListVo;
    }

    public UserAccountOverviewMakerLeaderboardListVo makerLeaderboardListAAA(String monthStr) {
        UserAccountOverviewMakerLeaderboardListVo userAccountOverviewMakerLeaderboardListVo = new UserAccountOverviewMakerLeaderboardListVo();
        userAccountOverviewMakerLeaderboardListVo.setOne(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(547805).setPhone("134****0116").setMakerInviteLevel(3).setAmount("395500"));
        userAccountOverviewMakerLeaderboardListVo.setTwo(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(31147).setPhone("159****4563").setMakerInviteLevel(2).setAmount("382700"));
        userAccountOverviewMakerLeaderboardListVo.setThree(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(480911).setPhone("185****1244").setMakerInviteLevel(1).setAmount("381000"));
        ArrayList<UserAccountOverviewMakerLeaderboardListInnerVo> userAccountOverviewMakerLeaderboardListInnerVos = new ArrayList<>();
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(993318).setPhone("159****5098").setMakerInviteLevel(3).setAmount("360000"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(827286).setPhone("152****3353").setMakerInviteLevel(1).setAmount("353600"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(582768).setPhone("184****6257").setMakerInviteLevel(3).setAmount("328700"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(592036).setPhone("136****5694").setMakerInviteLevel(2).setAmount("327000"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(423586).setPhone("181****6988").setMakerInviteLevel(1).setAmount("323700"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(787182).setPhone("147****8023").setMakerInviteLevel(1).setAmount("305500"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(46249).setPhone("133****4186").setMakerInviteLevel(3).setAmount("279300"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(524270).setPhone("158****7734").setMakerInviteLevel(2).setAmount("267400"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(325180).setPhone("177****0450").setMakerInviteLevel(3).setAmount("245900"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(497299).setPhone("135****5995").setMakerInviteLevel(3).setAmount("230800"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(650063).setPhone("139****0920").setMakerInviteLevel(2).setAmount("218600"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(256910).setPhone("184****1168").setMakerInviteLevel(1).setAmount("203200"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(166083).setPhone("153****0316").setMakerInviteLevel(3).setAmount("175200"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(799167).setPhone("177****0511").setMakerInviteLevel(1).setAmount("149800"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(421751).setPhone("156****2640").setMakerInviteLevel(3).setAmount("144100"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(937421).setPhone("177****1504").setMakerInviteLevel(1).setAmount("118600"));
        userAccountOverviewMakerLeaderboardListInnerVos.add(new UserAccountOverviewMakerLeaderboardListInnerVo().setUserId(421504).setPhone("178****8372").setMakerInviteLevel(1).setAmount("111000"));
        userAccountOverviewMakerLeaderboardListVo.setList(userAccountOverviewMakerLeaderboardListInnerVos);
        return userAccountOverviewMakerLeaderboardListVo;
    }

    //推手排行
    @Override
    public UserAccountOverviewMakerLeaderboardListVo makerLeaderboardList() {
        String monthStr = DateUtil.format(new Date(), "yyyyMM");
        return makerLeaderboardListAAA(monthStr);
    }

}
